{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "#Importing PulP solver\n",
    "from pulp import *"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "#Inputing the Demand points\n",
    "demand_points=['Port of King Abdul Aziz','Port of Mersin','Port of Jebel Ali']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['Port of King Abdul Aziz', 'Port of Mersin', 'Port of Jebel Ali']"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "demand_points"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "#Inputing the Supply Points\n",
    "supply_points=['Port of Santos','Sihanoukville','Douala','Port of Shanghai','Puerto Quetzal','Port of Jawaharlal Nehru','Port of Tanjung Priok','Port of Abidjan','Port of Monrovia','Penang Port','Port of Manzanillo','Port of Yangon','Port of Lagos','Port of Manila','Port of  Colombo','Port of Bangkok','Port of Saigon']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['Port of Santos',\n",
       " 'Sihanoukville',\n",
       " 'Douala',\n",
       " 'Port of Shanghai',\n",
       " 'Puerto Quetzal',\n",
       " 'Port of Jawaharlal Nehru',\n",
       " 'Port of Tanjung Priok',\n",
       " 'Port of Abidjan',\n",
       " 'Port of Monrovia',\n",
       " 'Penang Port',\n",
       " 'Port of Manzanillo',\n",
       " 'Port of Yangon',\n",
       " 'Port of Lagos',\n",
       " 'Port of Manila',\n",
       " 'Port of  Colombo',\n",
       " 'Port of Bangkok',\n",
       " 'Port of Saigon']"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "supply_points"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "#Inputing the distances\n",
    "distance = dict(zip(supply_points,[dict(zip(demand_points, [9716,7528,9407])),\n",
    "dict(zip(demand_points, [4908,6531,4613])),\n",
    "dict(zip(demand_points, [8325,9537,8017])),\n",
    "dict(zip(demand_points, [6922,8546,6627])),\n",
    "dict(zip(demand_points, [12259,8681,11949])),\n",
    "dict(zip(demand_points, [1630,3720,1335])),\n",
    "dict(zip(demand_points, [4700,6210,4405])),\n",
    "dict(zip(demand_points, [8877,5072,8568])),\n",
    "dict(zip(demand_points, [8259,4677,7951])),\n",
    "dict(zip(demand_points, [3896,5520,3601])),\n",
    "dict(zip(demand_points, [13099,9516,12790])),\n",
    "dict(zip(demand_points, [3982,5644,3687])),\n",
    "dict(zip(demand_points, [8624,5523,8316])),\n",
    "dict(zip(demand_points, [5834,7458,5539])),\n",
    "dict(zip(demand_points, [2572,4220,2276])),\n",
    "dict(zip(demand_points, [5142,6766,4847])), \n",
    "dict(zip(demand_points, [5004,6628,4709]))]))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'Port of Santos': {'Port of King Abdul Aziz': 9716,\n",
       "  'Port of Mersin': 7528,\n",
       "  'Port of Jebel Ali': 9407},\n",
       " 'Sihanoukville': {'Port of King Abdul Aziz': 4908,\n",
       "  'Port of Mersin': 6531,\n",
       "  'Port of Jebel Ali': 4613},\n",
       " 'Douala': {'Port of King Abdul Aziz': 8325,\n",
       "  'Port of Mersin': 9537,\n",
       "  'Port of Jebel Ali': 8017},\n",
       " 'Port of Shanghai': {'Port of King Abdul Aziz': 6922,\n",
       "  'Port of Mersin': 8546,\n",
       "  'Port of Jebel Ali': 6627},\n",
       " 'Puerto Quetzal': {'Port of King Abdul Aziz': 12259,\n",
       "  'Port of Mersin': 8681,\n",
       "  'Port of Jebel Ali': 11949},\n",
       " 'Port of Jawaharlal Nehru': {'Port of King Abdul Aziz': 1630,\n",
       "  'Port of Mersin': 3720,\n",
       "  'Port of Jebel Ali': 1335},\n",
       " 'Port of Tanjung Priok': {'Port of King Abdul Aziz': 4700,\n",
       "  'Port of Mersin': 6210,\n",
       "  'Port of Jebel Ali': 4405},\n",
       " 'Port of Abidjan': {'Port of King Abdul Aziz': 8877,\n",
       "  'Port of Mersin': 5072,\n",
       "  'Port of Jebel Ali': 8568},\n",
       " 'Port of Monrovia': {'Port of King Abdul Aziz': 8259,\n",
       "  'Port of Mersin': 4677,\n",
       "  'Port of Jebel Ali': 7951},\n",
       " 'Penang Port': {'Port of King Abdul Aziz': 3896,\n",
       "  'Port of Mersin': 5520,\n",
       "  'Port of Jebel Ali': 3601},\n",
       " 'Port of Manzanillo': {'Port of King Abdul Aziz': 13099,\n",
       "  'Port of Mersin': 9516,\n",
       "  'Port of Jebel Ali': 12790},\n",
       " 'Port of Yangon': {'Port of King Abdul Aziz': 3982,\n",
       "  'Port of Mersin': 5644,\n",
       "  'Port of Jebel Ali': 3687},\n",
       " 'Port of Lagos': {'Port of King Abdul Aziz': 8624,\n",
       "  'Port of Mersin': 5523,\n",
       "  'Port of Jebel Ali': 8316},\n",
       " 'Port of Manila': {'Port of King Abdul Aziz': 5834,\n",
       "  'Port of Mersin': 7458,\n",
       "  'Port of Jebel Ali': 5539},\n",
       " 'Port of  Colombo': {'Port of King Abdul Aziz': 2572,\n",
       "  'Port of Mersin': 4220,\n",
       "  'Port of Jebel Ali': 2276},\n",
       " 'Port of Bangkok': {'Port of King Abdul Aziz': 5142,\n",
       "  'Port of Mersin': 6766,\n",
       "  'Port of Jebel Ali': 4847},\n",
       " 'Port of Saigon': {'Port of King Abdul Aziz': 5004,\n",
       "  'Port of Mersin': 6628,\n",
       "  'Port of Jebel Ali': 4709}}"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "distance"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [],
   "source": [
    "#Inputing the Rubber Demand\n",
    "rubber_demand=dict(zip(demand_points, [54769494.6,47500474.2,52000490.0]))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'Port of King Abdul Aziz': 54769494.6,\n",
       " 'Port of Mersin': 47500474.2,\n",
       " 'Port of Jebel Ali': 52000490.0}"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "rubber_demand"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [],
   "source": [
    "#Inputing the Rubber Supply\n",
    "rubber_supply=dict(zip(supply_points, [1258648.3900,8234049.7510,217343.9060,8784079.7960,3935392.5450,6522791.1570,34239646.0300,3411326.1430,603911.1280,5312726.1900,330881.7674,1946363.3380,1386711.0420,2541650.1950,741564.4317,49185954.9800,25617418.0800])) "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'Port of Santos': 1258648.39,\n",
       " 'Sihanoukville': 8234049.751,\n",
       " 'Douala': 217343.906,\n",
       " 'Port of Shanghai': 8784079.796,\n",
       " 'Puerto Quetzal': 3935392.545,\n",
       " 'Port of Jawaharlal Nehru': 6522791.157,\n",
       " 'Port of Tanjung Priok': 34239646.03,\n",
       " 'Port of Abidjan': 3411326.143,\n",
       " 'Port of Monrovia': 603911.128,\n",
       " 'Penang Port': 5312726.19,\n",
       " 'Port of Manzanillo': 330881.7674,\n",
       " 'Port of Yangon': 1946363.338,\n",
       " 'Port of Lagos': 1386711.042,\n",
       " 'Port of Manila': 2541650.195,\n",
       " 'Port of  Colombo': 741564.4317,\n",
       " 'Port of Bangkok': 49185954.98,\n",
       " 'Port of Saigon': 25617418.08}"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "rubber_supply"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Set Problem Variables\n",
    "prob = LpProblem(\"Transportation\", LpMinimize)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Transportation:\n",
       "MINIMIZE\n",
       "None\n",
       "VARIABLES"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "prob"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Set Problem Variables\n",
    "routes = [(i,j) for i in supply_points for j in demand_points]\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[('Port of Santos', 'Port of King Abdul Aziz'),\n",
       " ('Port of Santos', 'Port of Mersin'),\n",
       " ('Port of Santos', 'Port of Jebel Ali'),\n",
       " ('Sihanoukville', 'Port of King Abdul Aziz'),\n",
       " ('Sihanoukville', 'Port of Mersin'),\n",
       " ('Sihanoukville', 'Port of Jebel Ali'),\n",
       " ('Douala', 'Port of King Abdul Aziz'),\n",
       " ('Douala', 'Port of Mersin'),\n",
       " ('Douala', 'Port of Jebel Ali'),\n",
       " ('Port of Shanghai', 'Port of King Abdul Aziz'),\n",
       " ('Port of Shanghai', 'Port of Mersin'),\n",
       " ('Port of Shanghai', 'Port of Jebel Ali'),\n",
       " ('Puerto Quetzal', 'Port of King Abdul Aziz'),\n",
       " ('Puerto Quetzal', 'Port of Mersin'),\n",
       " ('Puerto Quetzal', 'Port of Jebel Ali'),\n",
       " ('Port of Jawaharlal Nehru', 'Port of King Abdul Aziz'),\n",
       " ('Port of Jawaharlal Nehru', 'Port of Mersin'),\n",
       " ('Port of Jawaharlal Nehru', 'Port of Jebel Ali'),\n",
       " ('Port of Tanjung Priok', 'Port of King Abdul Aziz'),\n",
       " ('Port of Tanjung Priok', 'Port of Mersin'),\n",
       " ('Port of Tanjung Priok', 'Port of Jebel Ali'),\n",
       " ('Port of Abidjan', 'Port of King Abdul Aziz'),\n",
       " ('Port of Abidjan', 'Port of Mersin'),\n",
       " ('Port of Abidjan', 'Port of Jebel Ali'),\n",
       " ('Port of Monrovia', 'Port of King Abdul Aziz'),\n",
       " ('Port of Monrovia', 'Port of Mersin'),\n",
       " ('Port of Monrovia', 'Port of Jebel Ali'),\n",
       " ('Penang Port', 'Port of King Abdul Aziz'),\n",
       " ('Penang Port', 'Port of Mersin'),\n",
       " ('Penang Port', 'Port of Jebel Ali'),\n",
       " ('Port of Manzanillo', 'Port of King Abdul Aziz'),\n",
       " ('Port of Manzanillo', 'Port of Mersin'),\n",
       " ('Port of Manzanillo', 'Port of Jebel Ali'),\n",
       " ('Port of Yangon', 'Port of King Abdul Aziz'),\n",
       " ('Port of Yangon', 'Port of Mersin'),\n",
       " ('Port of Yangon', 'Port of Jebel Ali'),\n",
       " ('Port of Lagos', 'Port of King Abdul Aziz'),\n",
       " ('Port of Lagos', 'Port of Mersin'),\n",
       " ('Port of Lagos', 'Port of Jebel Ali'),\n",
       " ('Port of Manila', 'Port of King Abdul Aziz'),\n",
       " ('Port of Manila', 'Port of Mersin'),\n",
       " ('Port of Manila', 'Port of Jebel Ali'),\n",
       " ('Port of  Colombo', 'Port of King Abdul Aziz'),\n",
       " ('Port of  Colombo', 'Port of Mersin'),\n",
       " ('Port of  Colombo', 'Port of Jebel Ali'),\n",
       " ('Port of Bangkok', 'Port of King Abdul Aziz'),\n",
       " ('Port of Bangkok', 'Port of Mersin'),\n",
       " ('Port of Bangkok', 'Port of Jebel Ali'),\n",
       " ('Port of Saigon', 'Port of King Abdul Aziz'),\n",
       " ('Port of Saigon', 'Port of Mersin'),\n",
       " ('Port of Saigon', 'Port of Jebel Ali')]"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "routes"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Decision Variables\n",
    "X = LpVariable.dicts(\"ShipmentAmount\",(supply_points, demand_points),0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'Port of Santos': {'Port of King Abdul Aziz': ShipmentAmount_Port_of_Santos_Port_of_King_Abdul_Aziz,\n",
       "  'Port of Mersin': ShipmentAmount_Port_of_Santos_Port_of_Mersin,\n",
       "  'Port of Jebel Ali': ShipmentAmount_Port_of_Santos_Port_of_Jebel_Ali},\n",
       " 'Sihanoukville': {'Port of King Abdul Aziz': ShipmentAmount_Sihanoukville_Port_of_King_Abdul_Aziz,\n",
       "  'Port of Mersin': ShipmentAmount_Sihanoukville_Port_of_Mersin,\n",
       "  'Port of Jebel Ali': ShipmentAmount_Sihanoukville_Port_of_Jebel_Ali},\n",
       " 'Douala': {'Port of King Abdul Aziz': ShipmentAmount_Douala_Port_of_King_Abdul_Aziz,\n",
       "  'Port of Mersin': ShipmentAmount_Douala_Port_of_Mersin,\n",
       "  'Port of Jebel Ali': ShipmentAmount_Douala_Port_of_Jebel_Ali},\n",
       " 'Port of Shanghai': {'Port of King Abdul Aziz': ShipmentAmount_Port_of_Shanghai_Port_of_King_Abdul_Aziz,\n",
       "  'Port of Mersin': ShipmentAmount_Port_of_Shanghai_Port_of_Mersin,\n",
       "  'Port of Jebel Ali': ShipmentAmount_Port_of_Shanghai_Port_of_Jebel_Ali},\n",
       " 'Puerto Quetzal': {'Port of King Abdul Aziz': ShipmentAmount_Puerto_Quetzal_Port_of_King_Abdul_Aziz,\n",
       "  'Port of Mersin': ShipmentAmount_Puerto_Quetzal_Port_of_Mersin,\n",
       "  'Port of Jebel Ali': ShipmentAmount_Puerto_Quetzal_Port_of_Jebel_Ali},\n",
       " 'Port of Jawaharlal Nehru': {'Port of King Abdul Aziz': ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_King_Abdul_Aziz,\n",
       "  'Port of Mersin': ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_Mersin,\n",
       "  'Port of Jebel Ali': ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_Jebel_Ali},\n",
       " 'Port of Tanjung Priok': {'Port of King Abdul Aziz': ShipmentAmount_Port_of_Tanjung_Priok_Port_of_King_Abdul_Aziz,\n",
       "  'Port of Mersin': ShipmentAmount_Port_of_Tanjung_Priok_Port_of_Mersin,\n",
       "  'Port of Jebel Ali': ShipmentAmount_Port_of_Tanjung_Priok_Port_of_Jebel_Ali},\n",
       " 'Port of Abidjan': {'Port of King Abdul Aziz': ShipmentAmount_Port_of_Abidjan_Port_of_King_Abdul_Aziz,\n",
       "  'Port of Mersin': ShipmentAmount_Port_of_Abidjan_Port_of_Mersin,\n",
       "  'Port of Jebel Ali': ShipmentAmount_Port_of_Abidjan_Port_of_Jebel_Ali},\n",
       " 'Port of Monrovia': {'Port of King Abdul Aziz': ShipmentAmount_Port_of_Monrovia_Port_of_King_Abdul_Aziz,\n",
       "  'Port of Mersin': ShipmentAmount_Port_of_Monrovia_Port_of_Mersin,\n",
       "  'Port of Jebel Ali': ShipmentAmount_Port_of_Monrovia_Port_of_Jebel_Ali},\n",
       " 'Penang Port': {'Port of King Abdul Aziz': ShipmentAmount_Penang_Port_Port_of_King_Abdul_Aziz,\n",
       "  'Port of Mersin': ShipmentAmount_Penang_Port_Port_of_Mersin,\n",
       "  'Port of Jebel Ali': ShipmentAmount_Penang_Port_Port_of_Jebel_Ali},\n",
       " 'Port of Manzanillo': {'Port of King Abdul Aziz': ShipmentAmount_Port_of_Manzanillo_Port_of_King_Abdul_Aziz,\n",
       "  'Port of Mersin': ShipmentAmount_Port_of_Manzanillo_Port_of_Mersin,\n",
       "  'Port of Jebel Ali': ShipmentAmount_Port_of_Manzanillo_Port_of_Jebel_Ali},\n",
       " 'Port of Yangon': {'Port of King Abdul Aziz': ShipmentAmount_Port_of_Yangon_Port_of_King_Abdul_Aziz,\n",
       "  'Port of Mersin': ShipmentAmount_Port_of_Yangon_Port_of_Mersin,\n",
       "  'Port of Jebel Ali': ShipmentAmount_Port_of_Yangon_Port_of_Jebel_Ali},\n",
       " 'Port of Lagos': {'Port of King Abdul Aziz': ShipmentAmount_Port_of_Lagos_Port_of_King_Abdul_Aziz,\n",
       "  'Port of Mersin': ShipmentAmount_Port_of_Lagos_Port_of_Mersin,\n",
       "  'Port of Jebel Ali': ShipmentAmount_Port_of_Lagos_Port_of_Jebel_Ali},\n",
       " 'Port of Manila': {'Port of King Abdul Aziz': ShipmentAmount_Port_of_Manila_Port_of_King_Abdul_Aziz,\n",
       "  'Port of Mersin': ShipmentAmount_Port_of_Manila_Port_of_Mersin,\n",
       "  'Port of Jebel Ali': ShipmentAmount_Port_of_Manila_Port_of_Jebel_Ali},\n",
       " 'Port of  Colombo': {'Port of King Abdul Aziz': ShipmentAmount_Port_of__Colombo_Port_of_King_Abdul_Aziz,\n",
       "  'Port of Mersin': ShipmentAmount_Port_of__Colombo_Port_of_Mersin,\n",
       "  'Port of Jebel Ali': ShipmentAmount_Port_of__Colombo_Port_of_Jebel_Ali},\n",
       " 'Port of Bangkok': {'Port of King Abdul Aziz': ShipmentAmount_Port_of_Bangkok_Port_of_King_Abdul_Aziz,\n",
       "  'Port of Mersin': ShipmentAmount_Port_of_Bangkok_Port_of_Mersin,\n",
       "  'Port of Jebel Ali': ShipmentAmount_Port_of_Bangkok_Port_of_Jebel_Ali},\n",
       " 'Port of Saigon': {'Port of King Abdul Aziz': ShipmentAmount_Port_of_Saigon_Port_of_King_Abdul_Aziz,\n",
       "  'Port of Mersin': ShipmentAmount_Port_of_Saigon_Port_of_Mersin,\n",
       "  'Port of Jebel Ali': ShipmentAmount_Port_of_Saigon_Port_of_Jebel_Ali}}"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "X"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Objective Function\n",
    "prob += sum(X[i][j]*distance[i][j] for (i,j) in routes)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Transportation:\n",
       "MINIMIZE\n",
       "8017*ShipmentAmount_Douala_Port_of_Jebel_Ali + 8325*ShipmentAmount_Douala_Port_of_King_Abdul_Aziz + 9537*ShipmentAmount_Douala_Port_of_Mersin + 3601*ShipmentAmount_Penang_Port_Port_of_Jebel_Ali + 3896*ShipmentAmount_Penang_Port_Port_of_King_Abdul_Aziz + 5520*ShipmentAmount_Penang_Port_Port_of_Mersin + 8568*ShipmentAmount_Port_of_Abidjan_Port_of_Jebel_Ali + 8877*ShipmentAmount_Port_of_Abidjan_Port_of_King_Abdul_Aziz + 5072*ShipmentAmount_Port_of_Abidjan_Port_of_Mersin + 4847*ShipmentAmount_Port_of_Bangkok_Port_of_Jebel_Ali + 5142*ShipmentAmount_Port_of_Bangkok_Port_of_King_Abdul_Aziz + 6766*ShipmentAmount_Port_of_Bangkok_Port_of_Mersin + 1335*ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_Jebel_Ali + 1630*ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_King_Abdul_Aziz + 3720*ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_Mersin + 8316*ShipmentAmount_Port_of_Lagos_Port_of_Jebel_Ali + 8624*ShipmentAmount_Port_of_Lagos_Port_of_King_Abdul_Aziz + 5523*ShipmentAmount_Port_of_Lagos_Port_of_Mersin + 5539*ShipmentAmount_Port_of_Manila_Port_of_Jebel_Ali + 5834*ShipmentAmount_Port_of_Manila_Port_of_King_Abdul_Aziz + 7458*ShipmentAmount_Port_of_Manila_Port_of_Mersin + 12790*ShipmentAmount_Port_of_Manzanillo_Port_of_Jebel_Ali + 13099*ShipmentAmount_Port_of_Manzanillo_Port_of_King_Abdul_Aziz + 9516*ShipmentAmount_Port_of_Manzanillo_Port_of_Mersin + 7951*ShipmentAmount_Port_of_Monrovia_Port_of_Jebel_Ali + 8259*ShipmentAmount_Port_of_Monrovia_Port_of_King_Abdul_Aziz + 4677*ShipmentAmount_Port_of_Monrovia_Port_of_Mersin + 4709*ShipmentAmount_Port_of_Saigon_Port_of_Jebel_Ali + 5004*ShipmentAmount_Port_of_Saigon_Port_of_King_Abdul_Aziz + 6628*ShipmentAmount_Port_of_Saigon_Port_of_Mersin + 9407*ShipmentAmount_Port_of_Santos_Port_of_Jebel_Ali + 9716*ShipmentAmount_Port_of_Santos_Port_of_King_Abdul_Aziz + 7528*ShipmentAmount_Port_of_Santos_Port_of_Mersin + 6627*ShipmentAmount_Port_of_Shanghai_Port_of_Jebel_Ali + 6922*ShipmentAmount_Port_of_Shanghai_Port_of_King_Abdul_Aziz + 8546*ShipmentAmount_Port_of_Shanghai_Port_of_Mersin + 4405*ShipmentAmount_Port_of_Tanjung_Priok_Port_of_Jebel_Ali + 4700*ShipmentAmount_Port_of_Tanjung_Priok_Port_of_King_Abdul_Aziz + 6210*ShipmentAmount_Port_of_Tanjung_Priok_Port_of_Mersin + 3687*ShipmentAmount_Port_of_Yangon_Port_of_Jebel_Ali + 3982*ShipmentAmount_Port_of_Yangon_Port_of_King_Abdul_Aziz + 5644*ShipmentAmount_Port_of_Yangon_Port_of_Mersin + 2276*ShipmentAmount_Port_of__Colombo_Port_of_Jebel_Ali + 2572*ShipmentAmount_Port_of__Colombo_Port_of_King_Abdul_Aziz + 4220*ShipmentAmount_Port_of__Colombo_Port_of_Mersin + 11949*ShipmentAmount_Puerto_Quetzal_Port_of_Jebel_Ali + 12259*ShipmentAmount_Puerto_Quetzal_Port_of_King_Abdul_Aziz + 8681*ShipmentAmount_Puerto_Quetzal_Port_of_Mersin + 4613*ShipmentAmount_Sihanoukville_Port_of_Jebel_Ali + 4908*ShipmentAmount_Sihanoukville_Port_of_King_Abdul_Aziz + 6531*ShipmentAmount_Sihanoukville_Port_of_Mersin + 0\n",
       "VARIABLES\n",
       "ShipmentAmount_Douala_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Douala_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Douala_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Penang_Port_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Penang_Port_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Penang_Port_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Abidjan_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Abidjan_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Abidjan_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Bangkok_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Bangkok_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Bangkok_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Lagos_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Lagos_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Lagos_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Manila_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Manila_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Manila_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Manzanillo_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Manzanillo_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Manzanillo_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Monrovia_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Monrovia_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Monrovia_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Saigon_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Saigon_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Saigon_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Santos_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Santos_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Santos_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Shanghai_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Shanghai_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Shanghai_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Tanjung_Priok_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Tanjung_Priok_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Tanjung_Priok_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Yangon_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Yangon_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Yangon_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of__Colombo_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of__Colombo_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of__Colombo_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Puerto_Quetzal_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Puerto_Quetzal_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Puerto_Quetzal_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Sihanoukville_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Sihanoukville_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Sihanoukville_Port_of_Mersin Continuous"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "prob"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Transportation:\n",
       "MINIMIZE\n",
       "8017*ShipmentAmount_Douala_Port_of_Jebel_Ali + 8325*ShipmentAmount_Douala_Port_of_King_Abdul_Aziz + 9537*ShipmentAmount_Douala_Port_of_Mersin + 3601*ShipmentAmount_Penang_Port_Port_of_Jebel_Ali + 3896*ShipmentAmount_Penang_Port_Port_of_King_Abdul_Aziz + 5520*ShipmentAmount_Penang_Port_Port_of_Mersin + 8568*ShipmentAmount_Port_of_Abidjan_Port_of_Jebel_Ali + 8877*ShipmentAmount_Port_of_Abidjan_Port_of_King_Abdul_Aziz + 5072*ShipmentAmount_Port_of_Abidjan_Port_of_Mersin + 4847*ShipmentAmount_Port_of_Bangkok_Port_of_Jebel_Ali + 5142*ShipmentAmount_Port_of_Bangkok_Port_of_King_Abdul_Aziz + 6766*ShipmentAmount_Port_of_Bangkok_Port_of_Mersin + 1335*ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_Jebel_Ali + 1630*ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_King_Abdul_Aziz + 3720*ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_Mersin + 8316*ShipmentAmount_Port_of_Lagos_Port_of_Jebel_Ali + 8624*ShipmentAmount_Port_of_Lagos_Port_of_King_Abdul_Aziz + 5523*ShipmentAmount_Port_of_Lagos_Port_of_Mersin + 5539*ShipmentAmount_Port_of_Manila_Port_of_Jebel_Ali + 5834*ShipmentAmount_Port_of_Manila_Port_of_King_Abdul_Aziz + 7458*ShipmentAmount_Port_of_Manila_Port_of_Mersin + 12790*ShipmentAmount_Port_of_Manzanillo_Port_of_Jebel_Ali + 13099*ShipmentAmount_Port_of_Manzanillo_Port_of_King_Abdul_Aziz + 9516*ShipmentAmount_Port_of_Manzanillo_Port_of_Mersin + 7951*ShipmentAmount_Port_of_Monrovia_Port_of_Jebel_Ali + 8259*ShipmentAmount_Port_of_Monrovia_Port_of_King_Abdul_Aziz + 4677*ShipmentAmount_Port_of_Monrovia_Port_of_Mersin + 4709*ShipmentAmount_Port_of_Saigon_Port_of_Jebel_Ali + 5004*ShipmentAmount_Port_of_Saigon_Port_of_King_Abdul_Aziz + 6628*ShipmentAmount_Port_of_Saigon_Port_of_Mersin + 9407*ShipmentAmount_Port_of_Santos_Port_of_Jebel_Ali + 9716*ShipmentAmount_Port_of_Santos_Port_of_King_Abdul_Aziz + 7528*ShipmentAmount_Port_of_Santos_Port_of_Mersin + 6627*ShipmentAmount_Port_of_Shanghai_Port_of_Jebel_Ali + 6922*ShipmentAmount_Port_of_Shanghai_Port_of_King_Abdul_Aziz + 8546*ShipmentAmount_Port_of_Shanghai_Port_of_Mersin + 4405*ShipmentAmount_Port_of_Tanjung_Priok_Port_of_Jebel_Ali + 4700*ShipmentAmount_Port_of_Tanjung_Priok_Port_of_King_Abdul_Aziz + 6210*ShipmentAmount_Port_of_Tanjung_Priok_Port_of_Mersin + 3687*ShipmentAmount_Port_of_Yangon_Port_of_Jebel_Ali + 3982*ShipmentAmount_Port_of_Yangon_Port_of_King_Abdul_Aziz + 5644*ShipmentAmount_Port_of_Yangon_Port_of_Mersin + 2276*ShipmentAmount_Port_of__Colombo_Port_of_Jebel_Ali + 2572*ShipmentAmount_Port_of__Colombo_Port_of_King_Abdul_Aziz + 4220*ShipmentAmount_Port_of__Colombo_Port_of_Mersin + 11949*ShipmentAmount_Puerto_Quetzal_Port_of_Jebel_Ali + 12259*ShipmentAmount_Puerto_Quetzal_Port_of_King_Abdul_Aziz + 8681*ShipmentAmount_Puerto_Quetzal_Port_of_Mersin + 4613*ShipmentAmount_Sihanoukville_Port_of_Jebel_Ali + 4908*ShipmentAmount_Sihanoukville_Port_of_King_Abdul_Aziz + 6531*ShipmentAmount_Sihanoukville_Port_of_Mersin + 0\n",
       "SUBJECT TO\n",
       "_C1: ShipmentAmount_Douala_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Penang_Port_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Abidjan_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Bangkok_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Lagos_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Manila_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Manzanillo_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Monrovia_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Saigon_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Santos_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Shanghai_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Tanjung_Priok_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Yangon_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of__Colombo_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Puerto_Quetzal_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Sihanoukville_Port_of_King_Abdul_Aziz >= 54769494.6\n",
       "\n",
       "_C2: ShipmentAmount_Douala_Port_of_Mersin\n",
       " + ShipmentAmount_Penang_Port_Port_of_Mersin\n",
       " + ShipmentAmount_Port_of_Abidjan_Port_of_Mersin\n",
       " + ShipmentAmount_Port_of_Bangkok_Port_of_Mersin\n",
       " + ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_Mersin\n",
       " + ShipmentAmount_Port_of_Lagos_Port_of_Mersin\n",
       " + ShipmentAmount_Port_of_Manila_Port_of_Mersin\n",
       " + ShipmentAmount_Port_of_Manzanillo_Port_of_Mersin\n",
       " + ShipmentAmount_Port_of_Monrovia_Port_of_Mersin\n",
       " + ShipmentAmount_Port_of_Saigon_Port_of_Mersin\n",
       " + ShipmentAmount_Port_of_Santos_Port_of_Mersin\n",
       " + ShipmentAmount_Port_of_Shanghai_Port_of_Mersin\n",
       " + ShipmentAmount_Port_of_Tanjung_Priok_Port_of_Mersin\n",
       " + ShipmentAmount_Port_of_Yangon_Port_of_Mersin\n",
       " + ShipmentAmount_Port_of__Colombo_Port_of_Mersin\n",
       " + ShipmentAmount_Puerto_Quetzal_Port_of_Mersin\n",
       " + ShipmentAmount_Sihanoukville_Port_of_Mersin >= 47500474.2\n",
       "\n",
       "_C3: ShipmentAmount_Douala_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Penang_Port_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Abidjan_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Bangkok_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Lagos_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Manila_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Manzanillo_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Monrovia_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Saigon_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Santos_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Shanghai_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Tanjung_Priok_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Yangon_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of__Colombo_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Puerto_Quetzal_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Sihanoukville_Port_of_Jebel_Ali >= 52000490\n",
       "\n",
       "VARIABLES\n",
       "ShipmentAmount_Douala_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Douala_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Douala_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Penang_Port_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Penang_Port_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Penang_Port_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Abidjan_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Abidjan_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Abidjan_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Bangkok_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Bangkok_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Bangkok_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Lagos_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Lagos_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Lagos_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Manila_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Manila_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Manila_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Manzanillo_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Manzanillo_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Manzanillo_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Monrovia_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Monrovia_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Monrovia_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Saigon_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Saigon_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Saigon_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Santos_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Santos_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Santos_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Shanghai_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Shanghai_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Shanghai_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Tanjung_Priok_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Tanjung_Priok_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Tanjung_Priok_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Yangon_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Yangon_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Yangon_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of__Colombo_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of__Colombo_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of__Colombo_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Puerto_Quetzal_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Puerto_Quetzal_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Puerto_Quetzal_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Sihanoukville_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Sihanoukville_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Sihanoukville_Port_of_Mersin Continuous"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Constraints\n",
    "for j in demand_points:\n",
    "    prob += sum(X[i][j] for i in supply_points) >= rubber_demand[j]\n",
    "    \n",
    "prob"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Transportation:\n",
       "MINIMIZE\n",
       "8017*ShipmentAmount_Douala_Port_of_Jebel_Ali + 8325*ShipmentAmount_Douala_Port_of_King_Abdul_Aziz + 9537*ShipmentAmount_Douala_Port_of_Mersin + 3601*ShipmentAmount_Penang_Port_Port_of_Jebel_Ali + 3896*ShipmentAmount_Penang_Port_Port_of_King_Abdul_Aziz + 5520*ShipmentAmount_Penang_Port_Port_of_Mersin + 8568*ShipmentAmount_Port_of_Abidjan_Port_of_Jebel_Ali + 8877*ShipmentAmount_Port_of_Abidjan_Port_of_King_Abdul_Aziz + 5072*ShipmentAmount_Port_of_Abidjan_Port_of_Mersin + 4847*ShipmentAmount_Port_of_Bangkok_Port_of_Jebel_Ali + 5142*ShipmentAmount_Port_of_Bangkok_Port_of_King_Abdul_Aziz + 6766*ShipmentAmount_Port_of_Bangkok_Port_of_Mersin + 1335*ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_Jebel_Ali + 1630*ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_King_Abdul_Aziz + 3720*ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_Mersin + 8316*ShipmentAmount_Port_of_Lagos_Port_of_Jebel_Ali + 8624*ShipmentAmount_Port_of_Lagos_Port_of_King_Abdul_Aziz + 5523*ShipmentAmount_Port_of_Lagos_Port_of_Mersin + 5539*ShipmentAmount_Port_of_Manila_Port_of_Jebel_Ali + 5834*ShipmentAmount_Port_of_Manila_Port_of_King_Abdul_Aziz + 7458*ShipmentAmount_Port_of_Manila_Port_of_Mersin + 12790*ShipmentAmount_Port_of_Manzanillo_Port_of_Jebel_Ali + 13099*ShipmentAmount_Port_of_Manzanillo_Port_of_King_Abdul_Aziz + 9516*ShipmentAmount_Port_of_Manzanillo_Port_of_Mersin + 7951*ShipmentAmount_Port_of_Monrovia_Port_of_Jebel_Ali + 8259*ShipmentAmount_Port_of_Monrovia_Port_of_King_Abdul_Aziz + 4677*ShipmentAmount_Port_of_Monrovia_Port_of_Mersin + 4709*ShipmentAmount_Port_of_Saigon_Port_of_Jebel_Ali + 5004*ShipmentAmount_Port_of_Saigon_Port_of_King_Abdul_Aziz + 6628*ShipmentAmount_Port_of_Saigon_Port_of_Mersin + 9407*ShipmentAmount_Port_of_Santos_Port_of_Jebel_Ali + 9716*ShipmentAmount_Port_of_Santos_Port_of_King_Abdul_Aziz + 7528*ShipmentAmount_Port_of_Santos_Port_of_Mersin + 6627*ShipmentAmount_Port_of_Shanghai_Port_of_Jebel_Ali + 6922*ShipmentAmount_Port_of_Shanghai_Port_of_King_Abdul_Aziz + 8546*ShipmentAmount_Port_of_Shanghai_Port_of_Mersin + 4405*ShipmentAmount_Port_of_Tanjung_Priok_Port_of_Jebel_Ali + 4700*ShipmentAmount_Port_of_Tanjung_Priok_Port_of_King_Abdul_Aziz + 6210*ShipmentAmount_Port_of_Tanjung_Priok_Port_of_Mersin + 3687*ShipmentAmount_Port_of_Yangon_Port_of_Jebel_Ali + 3982*ShipmentAmount_Port_of_Yangon_Port_of_King_Abdul_Aziz + 5644*ShipmentAmount_Port_of_Yangon_Port_of_Mersin + 2276*ShipmentAmount_Port_of__Colombo_Port_of_Jebel_Ali + 2572*ShipmentAmount_Port_of__Colombo_Port_of_King_Abdul_Aziz + 4220*ShipmentAmount_Port_of__Colombo_Port_of_Mersin + 11949*ShipmentAmount_Puerto_Quetzal_Port_of_Jebel_Ali + 12259*ShipmentAmount_Puerto_Quetzal_Port_of_King_Abdul_Aziz + 8681*ShipmentAmount_Puerto_Quetzal_Port_of_Mersin + 4613*ShipmentAmount_Sihanoukville_Port_of_Jebel_Ali + 4908*ShipmentAmount_Sihanoukville_Port_of_King_Abdul_Aziz + 6531*ShipmentAmount_Sihanoukville_Port_of_Mersin + 0\n",
       "SUBJECT TO\n",
       "_C1: ShipmentAmount_Douala_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Penang_Port_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Abidjan_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Bangkok_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Lagos_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Manila_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Manzanillo_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Monrovia_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Saigon_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Santos_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Shanghai_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Tanjung_Priok_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Yangon_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of__Colombo_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Puerto_Quetzal_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Sihanoukville_Port_of_King_Abdul_Aziz >= 54769494.6\n",
       "\n",
       "_C2: ShipmentAmount_Douala_Port_of_Mersin\n",
       " + ShipmentAmount_Penang_Port_Port_of_Mersin\n",
       " + ShipmentAmount_Port_of_Abidjan_Port_of_Mersin\n",
       " + ShipmentAmount_Port_of_Bangkok_Port_of_Mersin\n",
       " + ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_Mersin\n",
       " + ShipmentAmount_Port_of_Lagos_Port_of_Mersin\n",
       " + ShipmentAmount_Port_of_Manila_Port_of_Mersin\n",
       " + ShipmentAmount_Port_of_Manzanillo_Port_of_Mersin\n",
       " + ShipmentAmount_Port_of_Monrovia_Port_of_Mersin\n",
       " + ShipmentAmount_Port_of_Saigon_Port_of_Mersin\n",
       " + ShipmentAmount_Port_of_Santos_Port_of_Mersin\n",
       " + ShipmentAmount_Port_of_Shanghai_Port_of_Mersin\n",
       " + ShipmentAmount_Port_of_Tanjung_Priok_Port_of_Mersin\n",
       " + ShipmentAmount_Port_of_Yangon_Port_of_Mersin\n",
       " + ShipmentAmount_Port_of__Colombo_Port_of_Mersin\n",
       " + ShipmentAmount_Puerto_Quetzal_Port_of_Mersin\n",
       " + ShipmentAmount_Sihanoukville_Port_of_Mersin >= 47500474.2\n",
       "\n",
       "_C3: ShipmentAmount_Douala_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Penang_Port_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Abidjan_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Bangkok_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Lagos_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Manila_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Manzanillo_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Monrovia_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Saigon_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Santos_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Shanghai_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Tanjung_Priok_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Yangon_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of__Colombo_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Puerto_Quetzal_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Sihanoukville_Port_of_Jebel_Ali >= 52000490\n",
       "\n",
       "_C4: ShipmentAmount_Port_of_Santos_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Santos_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Santos_Port_of_Mersin = 1258648.39\n",
       "\n",
       "_C5: ShipmentAmount_Sihanoukville_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Sihanoukville_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Sihanoukville_Port_of_Mersin = 8234049.751\n",
       "\n",
       "_C6: ShipmentAmount_Douala_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Douala_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Douala_Port_of_Mersin = 217343.906\n",
       "\n",
       "_C7: ShipmentAmount_Port_of_Shanghai_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Shanghai_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Shanghai_Port_of_Mersin = 8784079.796\n",
       "\n",
       "_C8: ShipmentAmount_Puerto_Quetzal_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Puerto_Quetzal_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Puerto_Quetzal_Port_of_Mersin = 3935392.545\n",
       "\n",
       "_C9: ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_Mersin = 6522791.157\n",
       "\n",
       "_C10: ShipmentAmount_Port_of_Tanjung_Priok_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Tanjung_Priok_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Tanjung_Priok_Port_of_Mersin = 34239646.03\n",
       "\n",
       "_C11: ShipmentAmount_Port_of_Abidjan_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Abidjan_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Abidjan_Port_of_Mersin = 3411326.143\n",
       "\n",
       "_C12: ShipmentAmount_Port_of_Monrovia_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Monrovia_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Monrovia_Port_of_Mersin = 603911.128\n",
       "\n",
       "_C13: ShipmentAmount_Penang_Port_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Penang_Port_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Penang_Port_Port_of_Mersin = 5312726.19\n",
       "\n",
       "_C14: ShipmentAmount_Port_of_Manzanillo_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Manzanillo_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Manzanillo_Port_of_Mersin = 330881.7674\n",
       "\n",
       "_C15: ShipmentAmount_Port_of_Yangon_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Yangon_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Yangon_Port_of_Mersin = 1946363.338\n",
       "\n",
       "_C16: ShipmentAmount_Port_of_Lagos_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Lagos_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Lagos_Port_of_Mersin = 1386711.042\n",
       "\n",
       "_C17: ShipmentAmount_Port_of_Manila_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Manila_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Manila_Port_of_Mersin = 2541650.195\n",
       "\n",
       "_C18: ShipmentAmount_Port_of__Colombo_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of__Colombo_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of__Colombo_Port_of_Mersin = 741564.4317\n",
       "\n",
       "_C19: ShipmentAmount_Port_of_Bangkok_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Bangkok_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Bangkok_Port_of_Mersin = 49185954.98\n",
       "\n",
       "_C20: ShipmentAmount_Port_of_Saigon_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Saigon_Port_of_King_Abdul_Aziz\n",
       " + ShipmentAmount_Port_of_Saigon_Port_of_Mersin = 25617418.08\n",
       "\n",
       "VARIABLES\n",
       "ShipmentAmount_Douala_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Douala_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Douala_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Penang_Port_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Penang_Port_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Penang_Port_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Abidjan_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Abidjan_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Abidjan_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Bangkok_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Bangkok_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Bangkok_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Lagos_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Lagos_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Lagos_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Manila_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Manila_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Manila_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Manzanillo_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Manzanillo_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Manzanillo_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Monrovia_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Monrovia_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Monrovia_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Saigon_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Saigon_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Saigon_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Santos_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Santos_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Santos_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Shanghai_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Shanghai_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Shanghai_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Tanjung_Priok_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Tanjung_Priok_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Tanjung_Priok_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of_Yangon_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Yangon_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of_Yangon_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Port_of__Colombo_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of__Colombo_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Port_of__Colombo_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Puerto_Quetzal_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Puerto_Quetzal_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Puerto_Quetzal_Port_of_Mersin Continuous\n",
       "ShipmentAmount_Sihanoukville_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Sihanoukville_Port_of_King_Abdul_Aziz Continuous\n",
       "ShipmentAmount_Sihanoukville_Port_of_Mersin Continuous"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Constraints\n",
    "for i in supply_points:\n",
    "    prob += sum(X[i][j] for j in demand_points) == rubber_supply[i]\n",
    "prob"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Status: Optimal\n",
      "ShipmentAmount_Douala_Port_of_Mersin = 217343.91\n",
      "ShipmentAmount_Penang_Port_Port_of_King_Abdul_Aziz = 5312726.2\n",
      "ShipmentAmount_Port_of_Abidjan_Port_of_Mersin = 3411326.1\n",
      "ShipmentAmount_Port_of_Bangkok_Port_of_Jebel_Ali = 31869396.0\n",
      "ShipmentAmount_Port_of_Bangkok_Port_of_King_Abdul_Aziz = 17316559.0\n",
      "ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_King_Abdul_Aziz = 6522791.2\n",
      "ShipmentAmount_Port_of_Lagos_Port_of_Mersin = 1386711.0\n",
      "ShipmentAmount_Port_of_Manila_Port_of_Jebel_Ali = 2541650.2\n",
      "ShipmentAmount_Port_of_Manzanillo_Port_of_Mersin = 330881.77\n",
      "ShipmentAmount_Port_of_Monrovia_Port_of_Mersin = 603911.13\n",
      "ShipmentAmount_Port_of_Saigon_Port_of_King_Abdul_Aziz = 25617418.0\n",
      "ShipmentAmount_Port_of_Santos_Port_of_Mersin = 1258648.4\n",
      "ShipmentAmount_Port_of_Shanghai_Port_of_Jebel_Ali = 8784079.8\n",
      "ShipmentAmount_Port_of_Tanjung_Priok_Port_of_Mersin = 34239646.0\n",
      "ShipmentAmount_Port_of_Yangon_Port_of_Jebel_Ali = 1946363.3\n",
      "ShipmentAmount_Port_of__Colombo_Port_of_Jebel_Ali = 741564.43\n",
      "ShipmentAmount_Puerto_Quetzal_Port_of_Mersin = 3935392.5\n",
      "ShipmentAmount_Sihanoukville_Port_of_Jebel_Ali = 6117436.5\n",
      "ShipmentAmount_Sihanoukville_Port_of_Mersin = 2116613.2\n",
      "Total kilogram_miles = 815503946286.98\n"
     ]
    }
   ],
   "source": [
    "prob.solve()\n",
    "\n",
    "print(\"Status:\", LpStatus[prob.status])\n",
    "\n",
    "for v in prob.variables():\n",
    "    if v.varValue > 0:\n",
    "        print(v.name, \"=\", v.varValue)\n",
    "\n",
    "print(\"Total kilogram_miles =\", value(prob.objective))\n"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
